package org.qf.web;

import lombok.extern.slf4j.Slf4j;
import org.qf.entity.SmbmsUser;
import org.qf.service.SmbmsUserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
@Slf4j
@Controller
public class SmbmsUserController {

    //调用业务层
    @Resource
    private SmbmsUserService smbmsUserService;

    @RequestMapping("/login")
    public String login(String username,String password){
        SmbmsUser smbmsUser = smbmsUserService.login(username,password);
log.info("{}",smbmsUser);
        if(smbmsUser != null){
            //代表业务层
            return "welcome";
        }else {
            //代表业务层
            return "login";
        }
    }
}
